<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center volumesize_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub volumesize_fd0_0'>
          <view class='flex flex-wrap align-center volumesize_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  volumesize_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='volumesize_fd0_0_c1_c0'>量体尺寸</text>
          </view>
          <view class='flex flex-wrap align-center justify-end volumesize_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout">
        <view class='flex flex-direction flex-wrap align-stretch volumesize_fd1_0' @tap.stop="handleJumpDiy"
          data-type="navigateTo" :data-url="`/pages/grzx/weddingDetails/weddingDetails`">
          <view class='flex flex-wrap align-center volumesize_fd1_0_c0'>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
              <view class='flex flex-wrap align-center volumesize_fd1_0_c0_c0_c0'>
                <text>{{info.customer_name}}</text>
                <text class='volumesize_fd1_0_c0_c0_c0_c1'>{{info.customer_phone}}</text>
                <image class='volumesize_fd1_0_c0_c0_c0_c2' mode="aspectFill" v-if="info.customer_types==3"
                  :src='STATIC_URL+"155.png"'></image>
                <image class='volumesize_fd1_0_c0_c0_c0_c2' mode="aspectFill" v-if="info.customer_types==1"
                  :src='STATIC_URL+"152.png"'></image>
                <image class='volumesize_fd1_0_c0_c0_c0_c2' mode="aspectFill" v-if="info.customer_types==2"
                  :src='STATIC_URL+"153.png"'></image>
                <image class='volumesize_fd1_0_c0_c0_c0_c2' mode="aspectFit" v-if="info.customer_types==4"
                  :src='STATIC_URL+"162.png"'></image>
              </view>
              <view class='flex flex-wrap align-center volumesize_fd1_0_c0_c0_c1'>
                <text class='volumesize_fd1_0_c0_c0_c1_c0'>婚期时间：</text>
                <text class='self-center'>{{info.date_time}}</text>
              </view>
            </view>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-wrap align-center volumesize_fd2_0'>
          <view class='flex flex-wrap align-center justify-center '
            :class="item.aid==typeId ? 'volumesize_fd2_0_c0' : 'volumesize_fd2_0_c1'" v-for="(item,index ) in typeList"
            :key="index" @click.stop="chooseCate(item)">
            <text>{{item.name}}</text>
          </view>
          <!-- <view class='flex flex-wrap align-center justify-center '>
            <text>新郎</text>
          </view> -->
        </view>
        <view class='flex flex-wrap align-center volumesize_fd2_1' v-if="bride_info.length">
          <view class='flex flex-direction flex-wrap align-stretch volumesize_fd2_1_c0' v-if="typeId==1 && index<22"
            v-for="(item,index ) in bride_info" :key="index">
            <text>{{item.name}}</text>
            <benben-input class='volumesize_fd2_1_c0_c1' type="text" :placeholder="`请输入`" confirm-type="done"
              :maxlength="15" v-model="item.value" :adjust-position='true'
              placeholder-style="color:#999;font-size:28rpx" />
          </view>
          <view class='flex flex-direction flex-wrap align-stretch volumesize_fd2_1_c0' v-if="typeId==2 && index<22"
            v-for="(item,index ) in groom_array" :key="index">
            <text>{{item.name}}</text>
            <benben-input class='volumesize_fd2_1_c0_c1' type="text" :placeholder="`请输入`" confirm-type="done"
              :maxlength="15" v-model="item.value" :adjust-position='true'
              placeholder-style="color:#999;font-size:28rpx" />
          </view>
          <view v-if="typeId==1">
            <view class='flex flex-wrap align-center justify-between newfollowup_fd1_1'>
              <view class='flex flex-wrap align-center newfollowup_fd1_0_c0'>

                <text>{{bride_info[22].name}}</text>
              </view>
            </view>
            <view class='flex flex-wrap newfollowup_fd1_2'>
              <benben-textarea class='flex newfollowup_input_fd1_2' :placeholder="'请输入备注'" :adjust-position='true'
                :maxlength="-1" :show-num='true' placeholder-style="color:#999;font-size:28rpx"
                v-model="bride_info[22].value" />
              <!-- <template>
                <view class='flex flex justify-end newfollowup_numberfd1_2_c0'>
                  <text>{{follow_content.length}}</text>
                  <text>/</text>
                  <text>240</text>
                </view>
              </template> -->
            </view>
            <view class='flex flex-wrap align-center justify-between newfollowup_fd1_1'>
              <view class='flex flex-wrap align-center newfollowup_fd1_0_c0'>
                <text>{{bride_info[23].name}} </text>
              </view>
            </view>
            <benben-images-upload ref="benbenImagesUploadfd1_4" :maxlength="9" :img-list.sync="bride_info[23].value"
              :is-show-tips='false'>
              <template #content="{ num, maxlength, isShow, imgList }">
                <view class="flex flex-wrap align-start flex newfollowup_fd1_4">

                  <view v-for="(image, index) in imgList" :key="index"
                    class='flex position-relative newfollowup_fd1_40'>
                    <text class='fu-iconfont2 position-absolute newfollowup_fd1_400'
                      @tap.stop="$refs.benbenImagesUploadfd1_4.delImage(index)">&#xE8E7;</text>
                    <image class='newfollowup_fd1_401' @tap.stop="$refs.benbenImagesUploadfd1_4.previewImage(index)"
                      mode="aspectFill" :src='image'></image>
                  </view>

                  <image class='newfollowup_fd1_41' @tap.stop="$refs.benbenImagesUploadfd1_4.manyChooseImage()"
                    v-if="isShow" mode="aspectFit" :src='STATIC_URL+"156.png"'></image>

                </view>
              </template>
            </benben-images-upload>
          </view>
          <view v-if="typeId==2">
            <view class='flex flex-wrap align-center justify-between newfollowup_fd1_1'>
              <view class='flex flex-wrap align-center newfollowup_fd1_0_c0'>

                <text>{{groom_array[22].name}}</text>
              </view>
            </view>
            <view class='flex flex-wrap newfollowup_fd1_2'>
              <benben-textarea class='flex newfollowup_input_fd1_2' :placeholder="'请输入备注'" :adjust-position='true'
                :maxlength="-1" :show-num='true' placeholder-style="color:#999;font-size:28rpx"
                v-model="groom_array[22].value" />
              <!-- <template>
                <view class='flex flex justify-end newfollowup_numberfd1_2_c0'>
                  <text>{{follow_content.length}}</text>
                  <text>/</text>
                  <text>240</text>
                </view>
              </template> -->
            </view>
            <view class='flex flex-wrap align-center justify-between newfollowup_fd1_1'>
              <view class='flex flex-wrap align-center newfollowup_fd1_0_c0'>
                <text>{{groom_array[23].name}} </text>
              </view>
            </view>

            <benben-images-upload ref="benbenImagesUploadfd1_5" :maxlength="9" :img-list.sync="groom_array[23].value"
              :is-show-tips='false'>
              <template #content="{ num, maxlength, isShow, imgList }">
                <view class="flex flex-wrap align-start flex newfollowup_fd1_4">

                  <view v-for="(image, index) in imgList" :key="index"
                    class='flex position-relative newfollowup_fd1_40'>
                    <text class='fu-iconfont2 position-absolute newfollowup_fd1_400'
                      @tap.stop="$refs.benbenImagesUploadfd1_5.delImage(index)">&#xE8E7;</text>
                    <image class='newfollowup_fd1_401' @tap.stop="$refs.benbenImagesUploadfd1_5.previewImage(index)"
                      mode="aspectFill" :src='image'></image>
                  </view>

                  <image class='newfollowup_fd1_41' @tap.stop="$refs.benbenImagesUploadfd1_5.manyChooseImage()"
                    v-if="isShow" mode="aspectFit" :src='STATIC_URL+"156.png"'></image>

                </view>
              </template>
            </benben-images-upload>
          </view>

        </view>
      </view>

      <!---flex布局flex布局结束-->
      <view class="flex benben-position-layout flex flex-wrap align-center volumesize_flex_3" @click="submit">
        <button class='volumesize_fd3_0'>确定</button>

      </view>
      <view :style="{height: '88rpx'}"></view>


    </view>
  </page-body>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        aid: '',
        info: '',
        dataList: [],
        groom_array: [], //新郎
        bride_info: [], //新娘
        groom_beizhu: '', //新郎备注
        groom_phone: [], //新郎图片
        bride_beizhu: '', //新娘备注
        bride_phone: [], //新新娘图片
        typeList: [{
          aid: 1,
          name: '新娘'
        }, {
          aid: 2,
          name: '新郎'
        }],
        typeId: '1',
        img_id: ''
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {
      let {
        aid
      } = options
      if (aid !== undefined) this.aid = aid

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      if (this.aid) {
        this.getDetail()
      }
    },
    onHide() {},
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      chooseCate(item) {
        this.typeId = item.aid

      },
      submit() {

        this.$api.post(global.apiUrls.post666d65c26c6a1, {
          aid: this.aid,
          groom_info: JSON.stringify(this.groom_array),
          bride_info: JSON.stringify(this.bride_info)
        }).then(res => {
          if (res.data.code == 1) {

            uni.navigateBack()
          } else {
            this.$message.info(res.data.msg)
          }
        })
      },
      getDetail() {
        this.$api.post(global.apiUrls.post666ceed1b0826, {
          aid: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.info = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post666d627421981, {
          aid: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.groom_array = res.data.data.groom_array
            this.groom_beizhu = this.groom_array[22]
            this.groom_phone = this.groom_array[23]

            this.bride_info = res.data.data.bride_info
            this.bride_beizhu = this.bride_info[22]
            this.bride_phone = this.bride_info[23]
          }
        })
      },
    }
  };
</script>
<style lang="scss" scoped>
  .newfollowup_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .newfollowup_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .newfollowup_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .newfollowup_fd0_0_c0 {
    width: 120rpx;
  }

  .newfollowup_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .newfollowup_fd1_41 {
    width: 160rpx;
    height: 160rpx;
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .newfollowup_fd1_401 {
    width: 160rpx;
    height: 160rpx;
  }

  .newfollowup_fd1_400 {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .newfollowup_fd1_40 {
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .newfollowup_fd1_4 {
    width: 686rpx;
    padding: 0 16rpx;
    // padding: 24rpx 0rpx 0rpx 24rpx;
    margin: 0rpx auto 0rpx auto;
  }

  .newfollowup_numberfd1_2_c0 {
    width: 100%;
    font-size: 24rpx;
    color: var(--benbenFontColor0);
    line-height: 46rpx;
    font-weight: 400;
  }

  .newfollowup_input_fd1_2 {
    width: 100%;
    height: 140rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
    white-space: pre-wrap;
  }

  .newfollowup_fd1_2 {
    background: #F8F8F8;
    border-radius: 8rpx;
    padding: 16rpx;
    margin: 0rpx auto 0rpx auto;
    width: 620rpx;
  }

  .newfollowup_fd1_1 {
    width: 620rpx;
    line-height: 100rpx;
    height: 100rpx;
    margin: 0rpx auto 0rpx auto;
  }

  .newfollowup_fd1_0_c1 {
    text-align: right;
  }

  .newfollowup_fd1_0_c0_c0 {
    color: var(--benbenFontColor5);
  }

  .newfollowup_fd1_0_c0 {
    height: 100rpx;
    line-height: 100rpx;
  }

  .newfollowup_fd1_0 {
    border-bottom: 1px solid #eee;
    width: 702rpx;
    line-height: 100rpx;
    height: 100rpx;
    margin: 0rpx auto 0rpx auto;
  }

  .newfollowup_flex_2 {
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    left: 32rpx;
    bottom: calc(80rpx + var(--window-bottom));
  }

  .newfollowup_fd2_0 {
    background: #F9E4C3;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor0);
    height: 88rpx;
  }

  .newfollowup_picker3_0_c2 {
    color: rgba(211, 152, 80, 1);
  }

  .newfollowup_picker3_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .volumesize_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .volumesize_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .volumesize_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .volumesize_fd0_0_c0 {
    width: 120rpx;
  }

  .volumesize_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .volumesize_fd1_0_c0_c0_c1_c0 {
    color: rgba(170, 170, 170, 1);
  }

  .volumesize_fd1_0_c0_c0_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .volumesize_fd1_0_c0_c0_c0_c2 {
    width: 115rpx;
    height: 34rpx;
  }

  .volumesize_fd1_0_c0_c0_c0_c1 {
    margin: 0rpx 24rpx 0rpx 24rpx;
  }

  .volumesize_fd1_0_c0_c0_c0 {
    font-weight: 600;
  }

  .volumesize_fd1_0_c0 {
    font-size: 32rpx;
  }

  .volumesize_fd1_0 {
    background: #FFFFFF;
    border-radius: 24rpx 24rpx 24rpx 24rpx;
    padding: 24rpx 24rpx 24rpx 24rpx;
    margin: 24rpx auto 0rpx auto;
    width: 686rpx;
  }

  .volumesize_fd2_1_c0_c1 {
    background: #EEEEEE;
    border-radius: 8rpx;
    width: 180rpx;
    height: 64rpx;
    line-height: 64rpx;
    margin: 16rpx 0rpx 0rpx 0rpx;
    padding: 0rpx 0rpx 0rpx 16rpx;
  }

  .volumesize_fd2_1_c0 {
    margin: 32rpx 0rpx 0rpx 26rpx;
  }

  .volumesize_fd2_1 {
    background: var(--benbenbgColor1);
    width: 686rpx;
    background-size: 100% auto;
    border-radius: 16rpx;
    margin: 0rpx auto 100rpx auto;
    padding: 0rpx 20rpx 32rpx 0rpx;
  }

  .volumesize_fd2_0_c1 {
    background: var(--benbenbgColor1);
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    width: 343rpx;
    height: 88rpx;
  }

  .volumesize_fd2_0_c0 {
    background: #F9E4C3;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    width: 343rpx;
    height: 88rpx;
  }

  .volumesize_fd2_0 {
    background: var(--benbenbgColor1);
    background-size: 100% auto;
    border-radius: 16rpx;
    width: 690rpx;
    margin: 24rpx auto 24rpx auto;
  }

  .volumesize_flex_3 {
    width: 750rpx;
    height: 120rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    left: 0;
    background-color: #FFFFFF;
  }

  .volumesize_fd3_0 {
    background: #F9E4C3;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor0);
    height: 88rpx;
    margin: 0 auto
  }
</style>
